#!/usr/bin/python3

import sys

def Hanoi(n, A, C, B):
    if n != 0:
        Hanoi(n - 1, A, B, C)
        #print 'Move the plate from', A, 'to', C
        print(A, '→', C, sep=' ')
        Hanoi(n - 1, B, C, A)

if __name__ = '__main__':
    Hanoi(int(sys.argv[1]), 'A', 'B', 'C')
